import random
import string
with open("jihuoma.txt", "a+", encoding="utf-8") as f:
    c = input("请输入你要多少个激活码：")
    if c.isdigit():
        c = int(c)
        for i in range(c):
            jihuoma = ''.join(random.sample(string.ascii_uppercase + string.digits, 32))
            f.write(jihuoma + '\n')
            print(jihuoma)
    else:
        print("请输入数字！！")